package vista;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.BorderLayout;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class vistaSerie {

	private JFrame frame;
	private JTextField textField;
	private JTextField textField_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					vistaSerie window = new vistaSerie();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public vistaSerie() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{434, 0};
		gridBagLayout.rowHeights = new int[]{32, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		frame.getContentPane().setLayout(gridBagLayout);
		
		JLabel lblTituloDeLa = new JLabel("Titulo de la Serie");
		lblTituloDeLa.setFont(new Font("Tahoma", Font.PLAIN, 26));
		lblTituloDeLa.setHorizontalAlignment(SwingConstants.CENTER);
		GridBagConstraints gbc_lblTituloDeLa = new GridBagConstraints();
		gbc_lblTituloDeLa.insets = new Insets(0, 0, 5, 0);
		gbc_lblTituloDeLa.anchor = GridBagConstraints.NORTH;
		gbc_lblTituloDeLa.fill = GridBagConstraints.HORIZONTAL;
		gbc_lblTituloDeLa.gridx = 0;
		gbc_lblTituloDeLa.gridy = 0;
		frame.getContentPane().add(lblTituloDeLa, gbc_lblTituloDeLa);
		
		textField = new JTextField();
		GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.insets = new Insets(0, 0, 5, 0);
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.gridx = 0;
		gbc_textField.gridy = 1;
		frame.getContentPane().add(textField, gbc_textField);
		textField.setColumns(10);
		
		JLabel lblGenero = new JLabel("Genero:");
		GridBagConstraints gbc_lblGenero = new GridBagConstraints();
		gbc_lblGenero.anchor = GridBagConstraints.WEST;
		gbc_lblGenero.insets = new Insets(0, 0, 5, 0);
		gbc_lblGenero.gridx = 0;
		gbc_lblGenero.gridy = 2;
		frame.getContentPane().add(lblGenero, gbc_lblGenero);
		
		textField_1 = new JTextField();
		GridBagConstraints gbc_textField_1 = new GridBagConstraints();
		gbc_textField_1.insets = new Insets(0, 0, 5, 0);
		gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_1.gridx = 0;
		gbc_textField_1.gridy = 1;
		frame.getContentPane().add(textField_1, gbc_textField_1);
		textField_1.setColumns(10);
		
		JLabel lblSinopsis = new JLabel("Sinopsis: ");
		GridBagConstraints gbc_lblSinopsis = new GridBagConstraints();
		gbc_lblSinopsis.anchor = GridBagConstraints.WEST;
		gbc_lblSinopsis.insets = new Insets(0, 0, 5, 0);
		gbc_lblSinopsis.gridx = 0;
		gbc_lblSinopsis.gridy = 3;
		frame.getContentPane().add(lblSinopsis, gbc_lblSinopsis);
		
		JTextArea textArea = new JTextArea();
		GridBagConstraints gbc_textArea = new GridBagConstraints();
		gbc_textArea.insets = new Insets(0, 0, 5, 0);
		gbc_textArea.fill = GridBagConstraints.BOTH;
		gbc_textArea.gridx = 0;
		gbc_textArea.gridy = 4;
		frame.getContentPane().add(textArea, gbc_textArea);
		
		JSplitPane splitPane = new JSplitPane();
		GridBagConstraints gbc_splitPane = new GridBagConstraints();
		gbc_splitPane.insets = new Insets(0, 0,0, 0);
		gbc_splitPane.gridx = 0;
		gbc_splitPane.gridy = 5;
		frame.getContentPane().add(splitPane, gbc_splitPane);
		
		JButton botonSeguir = new JButton("Seguir Serie");
		splitPane.setLeftComponent(botonSeguir);
		
		JButton botonCerrar = new JButton("Cerrar");
		botonCerrar.setSize(20,10 );
		botonCerrar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.dispose();
			}
		});
		splitPane.setRightComponent(botonCerrar);
	}
}
